/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author edilson
 */
@Entity
@Table(name = "Ementa")
public class Ementa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @Column(name="ementa")
    private String ementa;

    @JoinColumn(name="disciplinaProfessor", referencedColumnName= "id")
    @ManyToOne
    private DisciplinaProfessor disciplinaProfessor;
    @OneToMany(mappedBy = "ementa")
    private List<ConteudoDaEmenta> conteudoDaEmentas;

    public Ementa() {
    }

    public Ementa(Integer id) {
        this.id = id;
    }

    public Ementa(Integer id, DisciplinaProfessor disciplinaProfessor) {
        this.id = id;
        this.disciplinaProfessor = disciplinaProfessor;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public DisciplinaProfessor getDisciplinaProfessor() {
        return disciplinaProfessor;
    }

    public void setDisciplinaProfessor(DisciplinaProfessor disciplinaProfessor) {
        this.disciplinaProfessor = disciplinaProfessor;
    }

    public String getEmenta() {
        return ementa;
    }

    public void setEmenta(String ementa) {
        this.ementa = ementa;
    }

    public List<ConteudoDaEmenta> getConteudoDaEmentas() {
        return conteudoDaEmentas;
    }

    public void setConteudoDaEmentas(List<ConteudoDaEmenta> conteudoDaEmentas) {
        this.conteudoDaEmentas = conteudoDaEmentas;
    }

    


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ementa)) {
            return false;
        }
        Ementa other = (Ementa) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Ementa[id=" + id + "]";
    }

}
